//FAZER!
#include <cstdio>

//1--good
//0--bad
bool h[100000];
int n;
int max=0;
int tot=0;
void read(){
	scanf("%d", &n);
	for(int i=0;i<n;i++){
		scanf("%d", &h[i]);
		if(h[i])tot=0;
		else {
			tot++;
			if(tot>max){
				max = tot;
			}
		}
	}
	for(int i=0;i<n;i++){
		printf("%d", h[i]);
	}
}

void process(){
}

int main(){
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
	
	read();
	process();
	return 0;
}
